package com.ml.shs.controller;

import com.ml.shs.annotation.LoginAnnotation;
import com.ml.shs.entity.Discuss;
import com.ml.shs.service.DiscussService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/shs/discuss")
public class DiscussControlller {

    @Autowired
    DiscussService discussService;

    @GetMapping("getList")
    public List<Discuss> getList() {
        return discussService.getList();
    }

    @PostMapping("/save")
    @LoginAnnotation(name="没有登陆")
    public String save(@RequestBody Discuss discuss) {
        discussService.save(discuss);
        return "success";
    }
}
